calculating the sum of squares for the regression line